<?php

namespace App\Models;

use App\User;
use \Illuminate\Database\Eloquent\Model;

class Comment extends Model
{
    protected $table = 'tb_comment';// 表名

    public $fillable = ['user_id', 'time', 'goods_id', 'details', 'order_id'];// create 方法受此限制
    public $timestamps = false;// 关闭后  create方法不会修改 created_at updated_at 的值

    public function user()
    {
        return $this->hasOne(User::class, 'id', 'user_id');
    }
}
